home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 19
/
CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso
/
CUCD
/
Readers
/
Gui4Cli
/
Tools
/
fastread
/
MakeDoc.gc
< prev
next >
Wrap
Text File
|
1997-12-02
|
4KB
|
192 lines
G4C
; A document assembler for the Gui4Cli FastRead help system.
winbig -1 -1 360 139 "MakeDoc © G.Maddox 1997"
winsmall -1 -1 360 139
wintype 11110001
varpath ""
xonload
ifexists file c:type
;Nop
else
ezreq "I need the TYPE command in C:" Okay ""
guiquit makedoc.gc
endif
guiopen makedoc.gc
setgad makedoc.gc 3 on
setgad makedoc.gc 4 off
xonclose
ifexists file env:dbname
delete env:dbname
endif
guiquit makedoc.gc
xlistview 0 39 180 100 "" srcefile "" 0 dir
gadid 1
gadfont topaz.font 8 000
lvdirhook 1
extract srcefile file srcefile
lvuse makedoc.gc 2
lvadd $srcefile
xlvdirhook 1
cd $$lv.dir
xlistview 180 39 180 100 "" "" "" 0 txt
gadid 2
gadfont topaz.font 8 000
xbutton 0 0 70 13 Outfile
reqfile -1 -1 240 -60 "Select Output File" save outfile SYS:
if $outfile > ""
gosub makedoc.gc checkexist
extract outfile file dbtitle
update makedoc.gc 3 $outfile
setgad makedoc.gc 4 on
else
setgad makedoc.gc 3 on
endif
xtextin 70 0 290 13 "" outfile "" 512
gadid 3
if $outfile = ""
ezreq "You MUST supply a\ntarget path/filename!" Okay ""
setgad makedoc.gc 3 on
else
gosub makedoc.gc checkexist
extract outfile file dbtitle
setgad makedoc.gc 4 on
endif
xbutton 0 13 60 13 Volume
lvuse makedoc.gc 1
lvdir disks
xbutton 60 13 60 13 Root
lvuse makedoc.gc 1
lvdir root
xbutton 120 13 60 13 Parent
lvuse makedoc.gc 1
lvdir parent
xbutton 0 26 60 13 All
lvuse makedoc.gc 1
lvdir all
xbutton 60 26 60 13 None
lvuse makedoc.gc 1
lvdir none
xbutton 120 26 60 13 Xfer
gosub makedoc.gc nofile
while $srcefile > ""
ifexists dir $srcefile
lvmulti off
lvmulti next
else
extract srcefile file srcefile
lvuse makedoc.gc 2
lvadd $srcefile
lvuse makedoc.gc 1
lvmulti off
lvmulti next
endif
endwhile
xbutton 180 13 60 13 Clear
lvuse makedoc.gc 2
lvclear
xbutton 240 13 60 13 _Up
lvuse makedoc.gc 2
if $$lv.line > 0
dummy1 = $$lv.rec
lvgo prev
dummy2 = $$lv.rec
lvput $dummy1
lvgo next
lvput $dummy2
lvgo prev
endif
;--------------------
xbutton 300 13 60 13 Start
gadid 4
..dbname = '@database $dbtitle\n@Node main \"$dbtitle\"\n\nNODES :\n\n'
cli 'c:type env:dbname to $outfile'
lvuse makedoc.gc 2
lvgo first
guiwindow makedoc.gc wait
;--- make main node page - to make it AmigaGuide compatible
while $$lv.line > ""
append $outfile '\t@{\" $$lv.rec \" link \"$$lv.rec\"} \n'
lvgo next
endwhile
append $outfile '\n@endnode\n'
;---- join the files
lvgo first
while $$lv.line > ""
append $outfile '\n@node \"$$lv.rec\"\n\n'
cli 'c:type $$lv.rec >>$outfile'
append $outfile '\n@endnode\n'
lvgo next
endwhile
guiwindow makedoc.gc resume
lvclear
delvar outfile
update makedoc.gc 3 ""
setgad makedoc.gc 4 off
;---------------
xbutton 180 26 60 13 Remove
lvuse makedoc.gc 2
lvdel -1
xbutton 240 26 60 13 _Down
lvuse makedoc.gc 2
numlines = $$lv.total
counter numlines dec 1
if $$lv.line < $numlines
dummy1 = $$lv.rec
lvgo next
dummy2 = $$lv.rec
lvput $dummy1
lvgo prev
lvput $dummy2
lvgo next
endif
xbutton 300 26 60 13 Quit
guiclose makedoc.gc
xroutine nofile
lvuse makedoc.gc 1
lvmulti first
if $srcefile = ""
ezreq "No Files Selected" Okay ""
stop
endif
xroutine checkexist
ifexists file $outfile
ezreq "File already exists. If you\nproceed it will be appended to." Append|Cancel opt
if $opt = 1
return
else
delvar outfile
update makedoc.gc 3 ""
setgad makedoc.gc 4 off
stop
endif
endif